package com.qidianit.mes.pro.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * @Author: YKYB
 * @Date: 2025/9/21 15:26
 * @Description:
 */

public class JSONTools {
    private static ObjectMapper objectMapper = new ObjectMapper();

    public static String obj2json(Object obj){
        try {
            return objectMapper.writeValueAsString(obj);
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
    }
}
